package pl.edu.utp.kursy.database;

import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "inovices")
public class Inovice extends BaseId{
    
    @Column(name = "number")
    private String inoviceNumber;
    
    @Column(name = "issue_date")
    @Temporal(TemporalType.DATE)
    private Date issueDate;
    
    @Column(name = "seller_address")
    private String sellerAddress;
    
    @Column(name = "seller_name")
    private String sellerName;
    
    @Column(name = "seller_nip")
    private String sellerNIP;
    
    @Column(name = "customer_address")
    private String customerAddress;
    
    @Column(name = "customer_name")
    private String customerName;
    
    @Column(name = "customer_nip")
    private String customerNip;
    
    @Column(name = "sell_date")
    @Temporal(TemporalType.DATE)
    private Date sellDate;
    
    @Column(name = "value_netto")
    private double valueNetto;
    
    @Column(name = "value_vat")
    private double valueVat;
    
    @Column(name = "value_brutto")
    private double valueBrutto;
    
    @Column(name = "price_in_words")
    private String priceInWords;
    
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "inovice", cascade = CascadeType.REMOVE)
    private Set<InoviceRow> inoviceRows;
    
    @Column(name = "file_path")
    private String inoviceFilePath;

    public String getInoviceNumber() {
        return inoviceNumber;
    }

    public void setInoviceNumber(String inoviceNumber) {
        this.inoviceNumber = inoviceNumber;
    }

    public Date getIssueDate() {
        return issueDate;
    }

    public void setIssueDate(Date issueDate) {
        this.issueDate = issueDate;
    }

    public String getSellerAddress() {
        return sellerAddress;
    }

    public void setSellerAddress(String sellerAddress) {
        this.sellerAddress = sellerAddress;
    }

    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    public String getSellerNIP() {
        return sellerNIP;
    }

    public void setSellerNIP(String sellerNIP) {
        this.sellerNIP = sellerNIP;
    }

    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerNip() {
        return customerNip;
    }

    public void setCustomerNip(String customerNip) {
        this.customerNip = customerNip;
    }
    
    public Date getSellDate() {
        return sellDate;
    }

    public void setSellDate(Date sellDate) {
        this.sellDate = sellDate;
    }

    public double getValueNetto() {
        return valueNetto;
    }

    public void setValueNetto(double valueNetto) {
        this.valueNetto = valueNetto;
    }

    public double getValueVat() {
        return valueVat;
    }

    public void setValueVat(double valueVat) {
        this.valueVat = valueVat;
    }

    public double getValueBrutto() {
        return valueBrutto;
    }

    public void setValueBrutto(double valueBrutto) {
        this.valueBrutto = valueBrutto;
    }

    public String getPriceInWords() {
        return priceInWords;
    }

    public void setPriceInWords(String priceInWords) {
        this.priceInWords = priceInWords;
    }

    public Set<InoviceRow> getInoviceRows() {
        return inoviceRows;
    }

    public void setInoviceRows(Set<InoviceRow> inoviceRows) {
        this.inoviceRows = inoviceRows;
    }

    public String getInoviceFilePath() {
        return inoviceFilePath;
    }

    public void setInoviceFilePath(String inoviceFilePath) {
        this.inoviceFilePath = inoviceFilePath;
    }
    
}
